<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ include file="/jsp/taglib.jsp"%> 
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
	<%@ include file="/jsp/head.jsp"%>
 
	<link rel="stylesheet" href="${ctx}/assets/css/amazeui.min.css">
	<link rel="stylesheet" href="${ctx}/assets/css/admin.css">
	<link rel="stylesheet" href="${ctx}/assets/css/app.css">
	
	<%@ include file="/jsp/jslib.jsp"%>
	<script type="text/javascript">
		var PAGE_CONFIG = {'MENU_INDEX' : 1,'LI_INDEX' : 2};
	</script>
</head>
<body>
<%@ include file="/jsp/banner.jsp"%>
<div class="am-cf admin-main">
<%@ include file="/jsp/menu.jsp"%>

<!-- content start -->
<div class="admin-content">
<div class="admin-content-body">
<!-- ***** 分离出去 动态加载 start ***** -->
<div class="admin-content-body">
		
    <div class="am-cf am-padding am-padding-bottom-0">
      <div class="am-fl am-cf">
        <strong class="am-text-primary am-text-lg">查询项目详细信息</strong>
      </div>
    </div>
   	<hr>
   	
    <div class="am-tabs am-margin" data-am-tabs>
      <ul class="am-tabs-nav am-nav am-nav-tabs"></ul>
      <div class="am-tabs-bd">

        <div class="am-tab-panel am-fade am-in am-active" id="tab1">
			
			<div class="am-g am-margin-top">
			  <div class="am-u-sm-4 am-u-md-2 am-text-right">项目名称 </div>
			  <div class="am-u-sm-8 am-u-md-10">${project.projectName}</div>
			</div>
			<div class="am-g am-margin-top">
             <div class="am-u-sm-4 am-u-md-2 am-text-right"> 客户公司 </div>
             <div class="am-u-sm-8 am-u-md-10">
             	<c:forEach items="${customerCompanyList }" var = "customerCompany" >
        			<c:if test="${customerCompany.customerCompanyId == project.customerCompanyId}">${customerCompany.customerCompanyName }</c:if>
        		</c:forEach>
             </div>
            </div>
			<div class="am-g am-margin-top">
			  <div class="am-u-sm-4 am-u-md-2 am-text-right"> 客户人 </div>
			  <div class="am-u-sm-8 am-u-md-10">
			  	<c:forEach items="${customerList }" var = "customer" >
					<c:if test="${customer.customerId == project.customerId}">${customer.customerName }</c:if>
				</c:forEach>
			  </div>
			</div>
			<div class="am-g am-margin-top">
			  <div class="am-u-sm-4 am-u-md-2 am-text-right">  接单公司 </div>
			  <div class="am-u-sm-8 am-u-md-10">
				<c:forEach items="${companyList }" var = "company" >
					<c:if test="${company.companyId == project.companyId}">${company.companyName }</c:if>
				</c:forEach>
			  </div>
			</div>
			<div class="am-g am-margin-top">
			  <div class="am-u-sm-4 am-u-md-2 am-text-right">  负责人 </div>
			  <div class="am-u-sm-8 am-u-md-10">
			  	<c:forEach items="${staffList }" var = "staff" >
					<c:if test="${staff.staffId == project.staffId}">${staff.staffName }</c:if>
				</c:forEach>
			  </div>
			</div>
			<div class="am-g am-margin-top">
              <div class="am-u-sm-4 am-u-md-2 am-text-right">  项目进度 </div>
              <div class="am-u-sm-8 am-u-md-4 am-u-end col-end">${project.projectSchedule}</div>
            </div>
            <div class="am-g am-margin-top">
              <div class="am-u-sm-4 am-u-md-2 am-text-right">  报价 </div>
              <div class="am-u-sm-8 am-u-md-4 am-u-end col-end">${project.offer}</div>
            </div>
			<div class="am-g am-margin-top">
              <div class="am-u-sm-4 am-u-md-2 am-text-right">合同编码</div>
              <div class="am-u-sm-8 am-u-md-4 am-u-end col-end">${contract.contractCode}</div>
            </div>
            <div class="am-g am-margin-top">
              <div class="am-u-sm-4 am-u-md-2 am-text-right"> 项目状态 </div>
              <div class="am-u-sm-8 am-u-md-4 am-u-end col-end">
              	<c:forEach items="${projectStatus }" var = "status" >
           			<c:if test="${status.key == project.projectStatus}">${status.value}</c:if>
           		</c:forEach>
              	<%-- ${project.projectStatusValue}  --%>
              </div>
            </div>
            <div class="am-g am-margin-top">
              <div class="am-u-sm-4 am-u-md-2 am-text-right"> 是否有运维 </div>
              <div class="am-u-sm-8 am-u-md-4 am-u-end col-end">
              	<c:if test="${'Y' == project.isRepair}">有运维</c:if>
              	<c:if test="${'N' == project.isRepair}">无运维</c:if>
              </div>
            </div>
            <!-- <div class="am-g am-margin-top">
              <div class="am-u-sm-4 am-u-md-2 am-text-right"> 运维负责人 </div>
              <div class="am-u-sm-8 am-u-md-4 am-u-end col-end"></div>
            </div> -->
            <div class="am-g am-margin-top">
	            <div class="am-u-sm-4 am-u-md-2 am-text-right"> 供应商 </div>
	            <div class="am-u-sm-8 am-u-md-10">
		             <table class="am-table am-table-bd am-table-striped admin-content-table">
			            <thead>
				            <tr>
				              <th>供应商</th><th>出货</th><th>开票</th><th>开票类型</th><th>付款</th><th>付款日期</th>
				            </tr>
			            </thead>
			            <tbody>
			            	<c:forEach var="partnerDetail" items="${partnerDetailList}" varStatus="s">
				            <tr>
				            	<td>${partnerDetail.partnerCompanyName}</td>
				            	<td>
				            		<c:if test="${partnerDetail.isShipment == 'Y'}"><span class="am-badge am-badge-success">是</span></c:if>
				            		<c:if test="${partnerDetail.isShipment == 'N'}"><span class="am-badge am-badge-danger">否</span></c:if>
				            		<%-- <span class="am-badge am-badge-success">${partnerDetail.isShipment == 'Y' ? '是' : '否'}</span> --%>
				            	</td>
				            	<td>
				            		<c:if test="${partnerDetail.isBilling == 'Y'}"><span class="am-badge am-badge-success">是</span></c:if>
				            		<c:if test="${partnerDetail.isBilling == 'N'}"><span class="am-badge am-badge-danger">否</span></c:if>
				            	<%-- 	<span class="am-badge am-badge-success">${partnerDetail.isBilling == 'Y' ? '是' : '否'}</span> --%>
				            	</td>
				            	<td>
									<c:forEach items="${billingTypeMap }" var = "billing" >
				           				<c:if test="${billing.key == partnerDetail.billingType}">${billing.value}</c:if>
				           			</c:forEach>
								</td> 
				            	<td>
				            		<c:if test="${partnerDetail.isPayment == 'Y'}"><span class="am-badge am-badge-success">是</span></c:if>
				            		<c:if test="${partnerDetail.isPayment == 'N'}"><span class="am-badge am-badge-danger">否</span></c:if>
				            	<%-- 	<span class="am-badge am-badge-success">${partnerDetail.isPayment == 'Y' ? '是' : '否'}</span> --%>
				            	</td>
				              	<td><fmt:formatDate value='${partnerDetail.paymentDate}' pattern='yyyy-MM-dd'/></td>
				            </tr>
				            </c:forEach>
			            </tbody>
		          	</table>
		        </div>
			</div>
			<%-- <div class="am-g am-margin-top">
	            <div class="am-u-sm-4 am-u-md-2 am-text-right"> 合同 </div>
	            <div class="am-u-sm-8 am-u-md-4 am-u-end col-end"> 
					<label class="am-checkbox"><input type="checkbox"  value="" data-am-ucheck disabled 
						<c:if test="${'Y' == contract.isSign}">checked</c:if>>签订 </label>
				    <label class="am-checkbox"><input type="checkbox" value="" data-am-ucheck disabled 
				    	<c:if test="${'Y' == contract.isDelivery}">checked</c:if>>收款</label>
	            </div>
			</div>
			
			<div class="am-g am-margin-top">
	            <div class="am-u-sm-4 am-u-md-2 am-text-right">&nbsp;</div>
	            <div class="am-u-sm-8 am-u-md-2 ">
	            	签订日期:
	            </div>
	            <div class="am-u-sm-8 am-u-md-4 am-u-end col-end">
	            	<input type="date" name="signDate" value="<fmt:formatDate value='${contract.signDate}' pattern='yyyy-MM-dd'/>" class="am-form-field am-input-sm" placeholder="时间" disabled>
	            </div>
	        </div> --%>
	        
	        <div class="am-g am-margin-top">	 
			  	<div class="am-u-sm-4 am-u-md-2 am-text-right"> 合同 </div> 
			  	<div class="am-u-sm-8 am-u-md-8 am-u-end col-end"> 
					<div class="am-u-sm-8 am-u-md-2 ">
						<label class="am-checkbox"><input type="checkbox"  value="" data-am-ucheck disabled 
						<c:if test="${'Y' == contract.isSign}">checked</c:if>>签订 </label>
					</div>
					<div class="am-u-sm-8 am-u-md-8 am-u-end col-end">
						<div class="am-u-sm-8 am-u-md-4 ">签订日期:</div>
						<div class="am-u-sm-8 am-u-md-8 am-u-end col-end">
							<input type="date" name="signDate" value="<fmt:formatDate value='${contract.signDate}' pattern='yyyy-MM-dd'/>" class="am-form-field am-input-sm" placeholder="时间" disabled>
						</div>
					</div>
					
				</div>
			  
			</div>
			
			
			<div class="am-g am-margin-top">
				<div class="am-u-sm-4 am-u-md-2 am-text-right">&nbsp;</div>
				<div class="am-u-sm-8 am-u-md-8 am-u-end col-end"> 
					<div class="am-u-sm-8 am-u-md-2 ">
						<label class="am-checkbox"><input type="checkbox" value="" data-am-ucheck disabled 
				    	<c:if test="${'Y' == contract.isDelivery}">checked</c:if>>收款</label>
					</div>
					<div class="am-u-sm-8 am-u-md-8 am-u-end col-end">
						<div class="am-u-sm-8 am-u-md-4 ">交货日期:</div>
						<div class="am-u-sm-8 am-u-md-8 am-u-end col-end">
							<input type="date" name="deliveryDate" value="<fmt:formatDate value='${contract.deliveryDate}' pattern='yyyy-MM-dd'/>" class="am-form-field am-input-sm" placeholder="时间" disabled>
						</div>
					</div>
					
				</div>
			</div>
	        
			<div class="am-g am-margin-top">
	            <div class="am-u-sm-4 am-u-md-2 am-text-right"></div>
	            <div class="am-u-sm-8 am-u-md-10">
		             <table class="am-table am-table-bd am-table-striped admin-content-table">
			            <thead>
				            <tr>
				              <th>开票</th><th>开票类型</th><th>开票日期</th><th>开票金额</th><th>开票比例(%)</th>
				            </tr>
			            </thead>
			            <tbody>
			            	<c:forEach var="contractDetail" items="${contractBillingDetailList}" >
				            <tr>
				            	<td>
				            		<c:if test="${contractDetail.isBilling == 'Y'}"><span class="am-badge am-badge-success">是</span></c:if>
				            		<c:if test="${contractDetail.isBilling == 'N'}"><span class="am-badge am-badge-danger">否</span></c:if>
				            		<%-- <span class="am-badge am-badge-success">${contractDetail.isBilling == 'Y' ? '是' : '否'}</span> --%>
				            	</td>
				            	<td>
									<c:forEach items="${billingTypeMap }" var = "billing" >
				           				<c:if test="${billing.key == contractDetail.billingType}">${billing.value}</c:if>
				           			</c:forEach>
								</td>
				            	<td><fmt:formatDate value='${contractDetail.billingDate}' pattern='yyyy-MM-dd'/></td> 
				            	<td>${contractDetail.billingMoney}</td>
								<td>${contractDetail.billingRate}</td>
				            </tr>
				            </c:forEach>
			            </tbody>
		          	</table>
		        </div>
		    </div>
			<div class="am-g am-margin-top">
	            <div class="am-u-sm-4 am-u-md-2 am-text-right"></div>
	            <div class="am-u-sm-8 am-u-md-10">
		             <table class="am-table am-table-bd am-table-striped admin-content-table">
			            <thead>
				            <tr>
				              <!-- <th>ID</th> --><th>收款</th><th>收款日期</th><th>收款比例(%)</th>
				            </tr>
			            </thead>
			            <tbody>
			            	<c:forEach var="contractDetail" items="${contractPaymentDetailList}" >
				            <tr>
				            	<%-- <td>${contractDetail.contractDetailId}</td> --%>
				            	<td>
				            		<c:if test="${contractDetail.isPayment == 'Y'}"><span class="am-badge am-badge-success">是</span></c:if>
				            		<c:if test="${contractDetail.isPayment == 'N'}"><span class="am-badge am-badge-danger">否</span></c:if>
				            	</td>
				              	<td><fmt:formatDate value='${contractDetail.paymentDate}' pattern='yyyy-MM-dd'/></td>
				            	<td>${contractDetail.paymentRate}</td>
				            </tr>
				            </c:forEach>
			            </tbody>
		          	</table>
		        </div>
	        </div>
        </div>

      </div>
    </div>
	</div>
	<!-- ***** 分离出去 动态加载 end ***** -->
</div>
</div>
</div>

</body>
</html>